.class public Lcom/evernote/thrift/TBaseHelper;
.super Ljava/lang/Object;
.source "TBaseHelper.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/evernote/thrift/TBaseHelper$1;,
        Lcom/evernote/thrift/TBaseHelper$NestedStructureComparator;
    }
.end annotation


# static fields
.field private static final comparator:Ljava/util/Comparator;


# direct methods
.method static constructor <clinit>()V
    .registers 2

    .prologue
    .line 33
    new-instance v0, Lcom/evernote/thrift/TBaseHelper$NestedStructureComparator;

    const/4 v1, 0x0

    invoke-direct {v0, v1}, Lcom/evernote/thrift/TBaseHelper$NestedStructureComparator;-><init>(Lcom/evernote/thrift/TBaseHelper$1;)V

    sput-object v0, Lcom/evernote/thrift/TBaseHelper;->comparator:Ljava/util/Comparator;

    return-void
.end method

.method public constructor <init>()V
    .registers 1

    .prologue
    .line 31
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 199
    return-void
.end method

.method public static compareTo(BB)I
    .registers 3
    .param p0, "a"    # B
    .param p1, "b"    # B

    .prologue
    .line 56
    if-ge p0, p1, :cond_4

    .line 57
    const/4 v0, -0x1

    .line 61
    :goto_3
    return v0

    .line 58
    :cond_4
    if-ge p1, p0, :cond_8

    .line 59
    const/4 v0, 0x1

    goto :goto_3

    .line 61
    :cond_8
    const/4 v0, 0x0

    goto :goto_3
.end method

.method public static compareTo(DD)I
    .registers 6
    .param p0, "a"    # D
    .param p2, "b"    # D

    .prologue
    .line 96
    cmpg-double v0, p0, p2

    if-gez v0, :cond_6

    .line 97
    const/4 v0, -0x1

    .line 101
    :goto_5
    return v0

    .line 98
    :cond_6
    cmpg-double v0, p2, p0

    if-gez v0, :cond_c

    .line 99
    const/4 v0, 0x1

    goto :goto_5

    .line 101
    :cond_c
    const/4 v0, 0x0

    goto :goto_5
.end method

.method public static compareTo(II)I
    .registers 3
    .param p0, "a"    # I
    .param p1, "b"    # I

    .prologue
    .line 76
    if-ge p0, p1, :cond_4

    .line 77
    const/4 v0, -0x1

    .line 81
    :goto_3
    return v0

    .line 78
    :cond_4
    if-ge p1, p0, :cond_8

    .line 79
    const/4 v0, 0x1

    goto :goto_3

    .line 81
    :cond_8
    const/4 v0, 0x0

    goto :goto_3
.end method

.method public static compareTo(JJ)I
    .registers 6
    .param p0, "a"    # J
    .param p2, "b"    # J

    .prologue
    .line 86
    cmp-long v0, p0, p2

    if-gez v0, :cond_6

    .line 87
    const/4 v0, -0x1

    .line 91
    :goto_5
    return v0

    .line 88
    :cond_6
    cmp-long v0, p2, p0

    if-gez v0, :cond_c

    .line 89
    const/4 v0, 0x1

    goto :goto_5

    .line 91
    :cond_c
    const/4 v0, 0x0

    goto :goto_5
.end method

.method public static compareTo(Ljava/lang/Comparable;Ljava/lang/Comparable;)I
    .registers 3
    .param p0, "a"    # Ljava/lang/Comparable;
    .param p1, "b"    # Ljava/lang/Comparable;

    .prologue
    .line 124
    invoke-interface {p0, p1}, Ljava/lang/Comparable;->compareTo(Ljava/lang/Object;)I

    move-result v0

    return v0
.end method

.method public static compareTo(Ljava/lang/Object;Ljava/lang/Object;)I
    .registers 5
    .param p0, "o1"    # Ljava/lang/Object;
    .param p1, "o2"    # Ljava/lang/Object;

    .prologue
    .line 36
    instance-of v0, p0, Ljava/lang/Comparable;

    if-eqz v0, :cond_d

    .line 37
    check-cast p0, Ljava/lang/Comparable;

    .end local p0    # "o1":Ljava/lang/Object;
    check-cast p1, Ljava/lang/Comparable;

    .end local p1    # "o2":Ljava/lang/Object;
    invoke-static {p0, p1}, Lcom/evernote/thrift/TBaseHelper;->compareTo(Ljava/lang/Comparable;Ljava/lang/Comparable;)I

    move-result v0

    .line 45
    :goto_c
    return v0

    .line 38
    .restart local p0    # "o1":Ljava/lang/Object;
    .restart local p1    # "o2":Ljava/lang/Object;
    :cond_d
    instance-of v0, p0, Ljava/util/List;

    if-eqz v0, :cond_1a

    .line 39
    check-cast p0, Ljava/util/List;

    .end local p0    # "o1":Ljava/lang/Object;
    check-cast p1, Ljava/util/List;

    .end local p1    # "o2":Ljava/lang/Object;
    invoke-static {p0, p1}, Lcom/evernote/thrift/TBaseHelper;->compareTo(Ljava/util/List;Ljava/util/List;)I

    move-result v0

    goto :goto_c

    .line 40
    .restart local p0    # "o1":Ljava/lang/Object;
    .restart local p1    # "o2":Ljava/lang/Object;
    :cond_1a
    instance-of v0, p0, Ljava/util/Set;

    if-eqz v0, :cond_27

    .line 41
    check-cast p0, Ljava/util/Set;

    .end local p0    # "o1":Ljava/lang/Object;
    check-cast p1, Ljava/util/Set;

    .end local p1    # "o2":Ljava/lang/Object;
    invoke-static {p0, p1}, Lcom/evernote/thrift/TBaseHelper;->compareTo(Ljava/util/Set;Ljava/util/Set;)I

    move-result v0

    goto :goto_c

    .line 42
    .restart local p0    # "o1":Ljava/lang/Object;
    .restart local p1    # "o2":Ljava/lang/Object;
    :cond_27
    instance-of v0, p0, Ljava/util/Map;

    if-eqz v0, :cond_34

    .line 43
    check-cast p0, Ljava/util/Map;

    .end local p0    # "o1":Ljava/lang/Object;
    check-cast p1, Ljava/util/Map;

    .end local p1    # "o2":Ljava/lang/Object;
    invoke-static {p0, p1}, Lcom/evernote/thrift/TBaseHelper;->compareTo(Ljava/util/Map;Ljava/util/Map;)I

    move-result v0

    goto :goto_c

    .line 44
    .restart local p0    # "o1":Ljava/lang/Object;
    .restart local p1    # "o2":Ljava/lang/Object;
    :cond_34
    instance-of v0, p0, [B

    if-eqz v0, :cond_45

    .line 45
    check-cast p0, [B

    .end local p0    # "o1":Ljava/lang/Object;
    check-cast p0, [B

    check-cast p1, [B

    .end local p1    # "o2":Ljava/lang/Object;
    check-cast p1, [B

    invoke-static {p0, p1}, Lcom/evernote/thrift/TBaseHelper;->compareTo([B[B)I

    move-result v0

    goto :goto_c

    .line 47
    .restart local p0    # "o1":Ljava/lang/Object;
    .restart local p1    # "o2":Ljava/lang/Object;
    :cond_45
    new-instance v0, Ljava/lang/IllegalArgumentException;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Cannot compare objects of type "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method public static compareTo(Ljava/lang/String;Ljava/lang/String;)I
    .registers 3
    .param p0, "a"    # Ljava/lang/String;
    .param p1, "b"    # Ljava/lang/String;

    .prologue
    .line 106
    invoke-virtual {p0, p1}, Ljava/lang/String;->compareTo(Ljava/lang/String;)I

    move-result v0

    return v0
.end method

.method public static compareTo(Ljava/util/List;Ljava/util/List;)I
    .registers 7
    .param p0, "a"    # Ljava/util/List;
    .param p1, "b"    # Ljava/util/List;

    .prologue
    .line 128
    invoke-interface {p0}, Ljava/util/List;->size()I

    move-result v2

    invoke-interface {p1}, Ljava/util/List;->size()I

    move-result v3

    invoke-static {v2, v3}, Lcom/evernote/thrift/TBaseHelper;->compareTo(II)I

    move-result v1

    .line 129
    .local v1, "lastComparison":I
    if-eqz v1, :cond_10

    move v2, v1

    .line 138
    :goto_f
    return v2

    .line 132
    :cond_10
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_11
    invoke-interface {p0}, Ljava/util/List;->size()I

    move-result v2

    if-ge v0, v2, :cond_2c

    .line 133
    sget-object v2, Lcom/evernote/thrift/TBaseHelper;->comparator:Ljava/util/Comparator;

    invoke-interface {p0, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v3

    invoke-interface {p1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v4

    invoke-interface {v2, v3, v4}, Ljava/util/Comparator;->compare(Ljava/lang/Object;Ljava/lang/Object;)I

    move-result v1

    .line 134
    if-eqz v1, :cond_29

    move v2, v1

    .line 135
    goto :goto_f

    .line 132
    :cond_29
    add-int/lit8 v0, v0, 0x1

    goto :goto_11

    .line 138
    :cond_2c
    const/4 v2, 0x0

    goto :goto_f
.end method

.method public static compareTo(Ljava/util/Map;Ljava/util/Map;)I
    .registers 12
    .param p0, "a"    # Ljava/util/Map;
    .param p1, "b"    # Ljava/util/Map;

    .prologue
    .line 166
    invoke-interface {p0}, Ljava/util/Map;->size()I

    move-result v7

    invoke-interface {p1}, Ljava/util/Map;->size()I

    move-result v8

    invoke-static {v7, v8}, Lcom/evernote/thrift/TBaseHelper;->compareTo(II)I

    move-result v4

    .line 167
    .local v4, "lastComparison":I
    if-eqz v4, :cond_10

    move v7, v4

    .line 193
    :goto_f
    return v7

    .line 172
    :cond_10
    new-instance v5, Ljava/util/TreeMap;

    sget-object v7, Lcom/evernote/thrift/TBaseHelper;->comparator:Ljava/util/Comparator;

    invoke-direct {v5, v7}, Ljava/util/TreeMap;-><init>(Ljava/util/Comparator;)V

    .line 173
    .local v5, "sortedA":Ljava/util/SortedMap;
    invoke-interface {v5, p0}, Ljava/util/SortedMap;->putAll(Ljava/util/Map;)V

    .line 174
    invoke-interface {v5}, Ljava/util/SortedMap;->entrySet()Ljava/util/Set;

    move-result-object v7

    invoke-interface {v7}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v2

    .line 175
    .local v2, "iterA":Ljava/util/Iterator;, "Ljava/util/Iterator<Ljava/util/Map$Entry;>;"
    new-instance v6, Ljava/util/TreeMap;

    sget-object v7, Lcom/evernote/thrift/TBaseHelper;->comparator:Ljava/util/Comparator;

    invoke-direct {v6, v7}, Ljava/util/TreeMap;-><init>(Ljava/util/Comparator;)V

    .line 176
    .local v6, "sortedB":Ljava/util/SortedMap;
    invoke-interface {v6, p1}, Ljava/util/SortedMap;->putAll(Ljava/util/Map;)V

    .line 177
    invoke-interface {v6}, Ljava/util/SortedMap;->entrySet()Ljava/util/Set;

    move-result-object v7

    invoke-interface {v7}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v3

    .line 180
    .local v3, "iterB":Ljava/util/Iterator;, "Ljava/util/Iterator<Ljava/util/Map$Entry;>;"
    :cond_34
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v7

    if-eqz v7, :cond_70

    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v7

    if-eqz v7, :cond_70

    .line 181
    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/Map$Entry;

    .line 182
    .local v0, "entryA":Ljava/util/Map$Entry;
    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/util/Map$Entry;

    .line 183
    .local v1, "entryB":Ljava/util/Map$Entry;
    sget-object v7, Lcom/evernote/thrift/TBaseHelper;->comparator:Ljava/util/Comparator;

    invoke-interface {v0}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v8

    invoke-interface {v1}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v9

    invoke-interface {v7, v8, v9}, Ljava/util/Comparator;->compare(Ljava/lang/Object;Ljava/lang/Object;)I

    move-result v4

    .line 184
    if-eqz v4, :cond_5e

    move v7, v4

    .line 185
    goto :goto_f

    .line 187
    :cond_5e
    sget-object v7, Lcom/evernote/thrift/TBaseHelper;->comparator:Ljava/util/Comparator;

    invoke-interface {v0}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v8

    invoke-interface {v1}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v9

    invoke-interface {v7, v8, v9}, Ljava/util/Comparator;->compare(Ljava/lang/Object;Ljava/lang/Object;)I

    move-result v4

    .line 188
    if-eqz v4, :cond_34

    move v7, v4

    .line 189
    goto :goto_f

    .line 193
    .end local v0    # "entryA":Ljava/util/Map$Entry;
    .end local v1    # "entryB":Ljava/util/Map$Entry;
    :cond_70
    const/4 v7, 0x0

    goto :goto_f
.end method

.method public static compareTo(Ljava/util/Set;Ljava/util/Set;)I
    .registers 10
    .param p0, "a"    # Ljava/util/Set;
    .param p1, "b"    # Ljava/util/Set;

    .prologue
    .line 142
    invoke-interface {p0}, Ljava/util/Set;->size()I

    move-result v5

    invoke-interface {p1}, Ljava/util/Set;->size()I

    move-result v6

    invoke-static {v5, v6}, Lcom/evernote/thrift/TBaseHelper;->compareTo(II)I

    move-result v2

    .line 143
    .local v2, "lastComparison":I
    if-eqz v2, :cond_10

    move v5, v2

    .line 162
    :goto_f
    return v5

    .line 146
    :cond_10
    new-instance v3, Ljava/util/TreeSet;

    sget-object v5, Lcom/evernote/thrift/TBaseHelper;->comparator:Ljava/util/Comparator;

    invoke-direct {v3, v5}, Ljava/util/TreeSet;-><init>(Ljava/util/Comparator;)V

    .line 147
    .local v3, "sortedA":Ljava/util/SortedSet;
    invoke-interface {v3, p0}, Ljava/util/SortedSet;->addAll(Ljava/util/Collection;)Z

    .line 148
    new-instance v4, Ljava/util/TreeSet;

    sget-object v5, Lcom/evernote/thrift/TBaseHelper;->comparator:Ljava/util/Comparator;

    invoke-direct {v4, v5}, Ljava/util/TreeSet;-><init>(Ljava/util/Comparator;)V

    .line 149
    .local v4, "sortedB":Ljava/util/SortedSet;
    invoke-interface {v4, p1}, Ljava/util/SortedSet;->addAll(Ljava/util/Collection;)Z

    .line 151
    invoke-interface {v3}, Ljava/util/SortedSet;->iterator()Ljava/util/Iterator;

    move-result-object v0

    .line 152
    .local v0, "iterA":Ljava/util/Iterator;
    invoke-interface {v4}, Ljava/util/SortedSet;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .line 155
    .local v1, "iterB":Ljava/util/Iterator;
    :cond_2c
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v5

    if-eqz v5, :cond_4a

    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v5

    if-eqz v5, :cond_4a

    .line 156
    sget-object v5, Lcom/evernote/thrift/TBaseHelper;->comparator:Ljava/util/Comparator;

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v6

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v7

    invoke-interface {v5, v6, v7}, Ljava/util/Comparator;->compare(Ljava/lang/Object;Ljava/lang/Object;)I

    move-result v2

    .line 157
    if-eqz v2, :cond_2c

    move v5, v2

    .line 158
    goto :goto_f

    .line 162
    :cond_4a
    const/4 v5, 0x0

    goto :goto_f
.end method

.method public static compareTo(SS)I
    .registers 3
    .param p0, "a"    # S
    .param p1, "b"    # S

    .prologue
    .line 66
    if-ge p0, p1, :cond_4

    .line 67
    const/4 v0, -0x1

    .line 71
    :goto_3
    return v0

    .line 68
    :cond_4
    if-ge p1, p0, :cond_8

    .line 69
    const/4 v0, 0x1

    goto :goto_3

    .line 71
    :cond_8
    const/4 v0, 0x0

    goto :goto_3
.end method

.method public static compareTo(ZZ)I
    .registers 4
    .param p0, "a"    # Z
    .param p1, "b"    # Z

    .prologue
    .line 52
    invoke-static {p0}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v0

    invoke-static {p1}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/Boolean;->compareTo(Ljava/lang/Boolean;)I

    move-result v0

    return v0
.end method

.method public static compareTo([B[B)I
    .registers 7
    .param p0, "a"    # [B
    .param p1, "b"    # [B

    .prologue
    .line 110
    array-length v3, p0

    array-length v4, p1

    invoke-static {v3, v4}, Lcom/evernote/thrift/TBaseHelper;->compareTo(II)I

    move-result v2

    .line 111
    .local v2, "sizeCompare":I
    if-eqz v2, :cond_9

    .line 120
    .end local v2    # "sizeCompare":I
    :goto_8
    return v2

    .line 114
    .restart local v2    # "sizeCompare":I
    :cond_9
    const/4 v1, 0x0

    .local v1, "i":I
    :goto_a
    array-length v3, p0

    if-ge v1, v3, :cond_1c

    .line 115
    aget-byte v3, p0, v1

    aget-byte v4, p1, v1

    invoke-static {v3, v4}, Lcom/evernote/thrift/TBaseHelper;->compareTo(BB)I

    move-result v0

    .line 116
    .local v0, "byteCompare":I
    if-eqz v0, :cond_19

    move v2, v0

    .line 117
    goto :goto_8

    .line 114
    :cond_19
    add-int/lit8 v1, v1, 0x1

    goto :goto_a

    .line 120
    .end local v0    # "byteCompare":I
    :cond_1c
    const/4 v2, 0x0

    goto :goto_8
.end method

.method public static paddedByteString(B)Ljava/lang/String;
    .registers 4
    .param p0, "b"    # B

    .prologue
    .line 248
    or-int/lit16 v1, p0, 0x100

    and-int/lit16 v0, v1, 0x1ff

    .line 249
    .local v0, "extended":I
    invoke-static {v0}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/String;->toUpperCase()Ljava/lang/String;

    move-result-object v1

    const/4 v2, 0x1

    invoke-virtual {v1, v2}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v1

    return-object v1
.end method

.method public static toString(Ljava/nio/ByteBuffer;Ljava/lang/StringBuilder;)V
    .registers 5
    .param p0, "bb"    # Ljava/nio/ByteBuffer;
    .param p1, "sb"    # Ljava/lang/StringBuilder;

    .prologue
    .line 226
    invoke-virtual {p0}, Ljava/nio/ByteBuffer;->array()[B

    move-result-object v1

    .line 228
    .local v1, "buf":[B
    invoke-virtual {p0}, Ljava/nio/ByteBuffer;->arrayOffset()I

    move-result v0

    .line 229
    .local v0, "arrayOffset":I
    invoke-virtual {p0}, Ljava/nio/ByteBuffer;->limit()I

    move-result v2

    .line 230
    .local v2, "origLimit":I
    invoke-static {v1, v0, v2, p1}, Lcom/evernote/thrift/TBaseHelper;->toString([BIILjava/lang/StringBuilder;)V

    .line 231
    return-void
.end method

.method public static toString([BIILjava/lang/StringBuilder;)V
    .registers 8
    .param p0, "buf"    # [B
    .param p1, "arrayOffset"    # I
    .param p2, "origLimit"    # I
    .param p3, "sb"    # Ljava/lang/StringBuilder;

    .prologue
    .line 234
    sub-int v2, p2, p1

    const/16 v3, 0x80

    if-le v2, v3, :cond_1e

    add-int/lit16 v1, p1, 0x80

    .line 236
    .local v1, "limit":I
    :goto_8
    move v0, p1

    .local v0, "i":I
    :goto_9
    if-ge v0, v1, :cond_20

    .line 237
    if-le v0, p1, :cond_12

    .line 238
    const-string v2, " "

    invoke-virtual {p3, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 240
    :cond_12
    aget-byte v2, p0, v0

    invoke-static {v2}, Lcom/evernote/thrift/TBaseHelper;->paddedByteString(B)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {p3, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 236
    add-int/lit8 v0, v0, 0x1

    goto :goto_9

    .end local v0    # "i":I
    .end local v1    # "limit":I
    :cond_1e
    move v1, p2

    .line 234
    goto :goto_8

    .line 242
    .restart local v0    # "i":I
    .restart local v1    # "limit":I
    :cond_20
    if-eq p2, v1, :cond_27

    .line 243
    const-string v2, "..."

    invoke-virtual {p3, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 245
    :cond_27
    return-void
.end method

.method public static toString([BLjava/lang/StringBuilder;)V
    .registers 4
    .param p0, "bytes"    # [B
    .param p1, "sb"    # Ljava/lang/StringBuilder;

    .prologue
    .line 222
    const/4 v0, 0x0

    array-length v1, p0

    invoke-static {p0, v0, v1, p1}, Lcom/evernote/thrift/TBaseHelper;->toString([BIILjava/lang/StringBuilder;)V

    .line 223
    return-void
.end method
